function setRem() {
    //视口的宽度
    let clientWidth = parseInt(document.documentElement.clientWidth)
    let app = document.getElementById('app')
    if (clientWidth > 750) {
      clientWidth = 750
      app.style.width = '750px'
      app.style.margin = '0 auto'
      app.style.border = '1px solid #ddd'
    }
    //计算比例
    let rate = (clientWidth / 750) * 100
    console.log(clientWidth, rate)
    //document.documentElement===html
    document.documentElement.style.fontSize = rate + 'px'
  }
  window.onload = setRem
  window.onresize = setRem
  